package com.bc.mcode.model;

import com.bc.mcode.util.DesUtil;
import com.bc.mcode.util.JSONUtils;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class BaseVO {
    private static final long serialVersionUID = 1L;

    public BaseVO() {
    }

    public String toJsonString() {
        return JSONUtils.beanToJson(this);
    }


    private Object getFieldValueByName(String fieldName, Object o) {
        try {
            String firstLetter = fieldName.substring(0, 1).toUpperCase();
            String getter = "get" + firstLetter + fieldName.substring(1);
            Method method = o.getClass().getMethod(getter);
            Object value = method.invoke(o);
            return value;
        } catch (Exception var7) {
            var7.printStackTrace();
            return null;
        }
    }
}
